package com.wyh.controller.feemanagementcontroller;


import com.wyh.common.result.Result;
import com.wyh.domain.po.feemanagementpo.Customers;
import com.wyh.domain.po.feemanagementpo.Resourcees;
import com.wyh.service.feemanagementservice.IContractService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 合同表 前端控制器
 * </p>
 *
 * @author ggt
 * @since 2024-05-29
 */
@RestController
@RequestMapping("/contract")
@RequiredArgsConstructor
@Api(tags = "合同")
public class ContractController {

    private final IContractService contractService;

    @ApiOperation("根据客户id获取对应资源信息")
    @GetMapping("/getResourceBycustomerId/{customId}")
    public Result<List<Resourcees>> getResourceBycustomerId(@PathVariable Integer customId) {
        return Result.success(contractService.getResorceByCustId(customId));
    }

    @ApiOperation("合同资源对应的客户的信息")
    @GetMapping("/getCustomerByResourceId/{resourceId}")
    public Result<List<Customers>> getCustomerByResourceId(@PathVariable Integer resourceId) {
        return Result.success(contractService.getCustomerByResourceId(resourceId));
    }



}
